package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class SetPermissionRequest extends BaseTokenRequest {

    public static final String PATH = BaseRequest.PATH + "api/Setup_ConcernedPeoplePower";

    private int babyId;

    private int userId;

    private int role;

    private int permission;

    private int range;

    public int getBabyId() {
        return babyId;
    }

    public void setBabyId(int babyId) {
        this.babyId = babyId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public int getPermission() {
        return permission;
    }

    public void setPermission(int permission) {
        this.permission = permission;
    }

    public int getRange() {
        return range;
    }

    public void setRange(int range) {
        this.range = range;
    }

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        SetPermissionRequestBody body = new SetPermissionRequestBody();
        body.setPhone(getPhone());
        body.setToken(getToken());
        body.setBabyId(getBabyId());
        body.setUserId(getUserId());
        body.setRole(getRole());
        body.setPermission(getPermission());
        body.setRange(getRange());
        return body;
    }

    private class SetPermissionRequestBody extends BaseTokenRequestBody {

        @SerializedName("BabyID")
        private int babyId;

        @SerializedName("UserID")
        private int userId;

        @SerializedName("Role")
        private int role;

        @SerializedName("Power")
        private int permission;

        @SerializedName("ViewRange")
        private int range;

        private SetPermissionRequestBody() {
            setSv(BaseRequestConfig.SV_SET_PERMISSION);
        }

        public int getBabyId() {
            return babyId;
        }

        public void setBabyId(int babyId) {
            this.babyId = babyId;
        }

        public int getUserId() {
            return userId;
        }

        public void setUserId(int userId) {
            this.userId = userId;
        }

        public int getRole() {
            return role;
        }

        public void setRole(int role) {
            this.role = role;
        }

        public int getPermission() {
            return permission;
        }

        public void setPermission(int permission) {
            this.permission = permission;
        }

        public int getRange() {
            return range;
        }

        public void setRange(int range) {
            this.range = range;
        }
    }
}
